{template 'common/header'}
{template 'nav'}
<style>
input[name="menu[icon][]"]{display:none}
</style>
<form action="" class="form-horizontal form ng-pristine ng-valid" method="post" enctype="multipart/form-data">
<div role="tabpanel" class="tab-pane" id="cjsz">
					<div class="panel-heading" style="color: #333;background-color: #f5f5f5;border-color: #ddd;">
					自定义底部菜单<br>
					修改了或者删除后 请记得保存
					</div>					
					<div class="panel-body">

						<div id="form-menu">
							{loop $menus $val}
							<div class="form-group">
								<div class="col-sm-12 col-xs-12">

									<div class="col-xs-12 col-sm-12 col-md-4 col-lg-1">
										<div class="input-group" style="margin-left:-15px;margin-bottom:10px">
											<input type="text" class="form-control" name="displayorder[]" value="{$val['displayorder']}" placeholder="排序" />
										</div>
									</div>	
									
									<div class="col-xs-12 col-sm-12 col-md-4 col-lg-2">
										<div class="input-group" style="margin-left:-15px;margin-bottom:10px">
											<span class="input-group-addon">名称</span>
											<input type="text" class="form-control" name="name[]" value="{$val['name']}" placeholder="" />
										</div>
									</div>
															
									<div class="col-xs-12 col-sm-12 col-md-4 col-lg-3">
										<div class="input-group" style="margin-left:-15px;margin-bottom:10px">
											<span class="input-group-addon">链接</span>
											{php echo tpl_form_field_link('url[]',$val['url']);}
											
										</div>
									</div>	
									
									<div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
										<div class="input-group" style="margin-left:-15px;margin-bottom:10px">
											{php echo tpl_form_field_icon('icon[]', $val['icon']);}
										</div>
									</div>
									
									<div class="col-xs-12 col-sm-12 col-md-4 col-lg-3 ">
										<div style="margin-left:-15px;margin-bottom:17px">
										<label class="checkbox-inline" style="vertical-align:bottom">
											<input type="hidden" name="isshow[]" value="{$val['isshow']}">
											<input type="checkbox" {if !empty($val['isshow'])}checked{/if} onclick="$(this).prev().val(this.checked ? '1' : '0');"> 是否显示
										</label>
										
										<label class="checkbox-inline" style="vertical-align:bottom">操作</label>
										&nbsp; &nbsp; &nbsp; <a href="javascript:;" onclick="$(this).closest('.form-group').remove();" class="fa fa-times-circle" title="删除此操作"></a>
										</div>
									</div>									
								</div>
							</div>	
							{/loop}
						</div>	
					
						<div class="form-group">
							<div class="col-sm-12 col-xs-12">
								<div class="well well-sm">
									<a href="javascript:;" onclick="addMenu();">添加菜单 <i class="fa fa-plus-circle" title="添加菜单"></i></a>
								</div>
							</div>
						</div> 	
						<div class="form-group">
							<div class="col-sm-12">
								<input name="token" type="hidden" value="{$_W['token']}" />
								<input type="submit" class="btn btn-primary" name="submit" value="保存">
							</div>
						</div>
					</div>
</div>
</form>
<div id="form-option-menu"  style="display:none">
							<div class="form-group">
								<div class="col-sm-12 col-xs-12">

									<div class="col-xs-12 col-sm-12 col-md-4 col-lg-1">
										<div class="input-group" style="margin-left:-15px;margin-bottom:10px">
											<input type="text" class="form-control" name="displayorder[]" value="" placeholder="排序" />
										</div>
									</div>
									
									<div class="col-xs-12 col-sm-12 col-md-4 col-lg-2">
										<div class="input-group" style="margin-left:-15px;margin-bottom:10px">
											<span class="input-group-addon">名称</span>
											<input type="text" class="form-control" name="name[]" value="" placeholder="" />
										</div>
									</div>
																
									<div class="col-xs-12 col-sm-12 col-md-4 col-lg-3">
										<div class="input-group" style="margin-left:-15px;margin-bottom:10px">
											<span class="input-group-addon">链接</span>
											{php echo tpl_form_field_link('url[]');}
											<!--input type="text" class="form-control" name="menu[url][]" value="" placeholder="" /-->
										</div>
									</div>	
									
									<div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
										<div class="input-group" style="margin-left:-15px;margin-bottom:10px">
											{php echo tpl_form_field_icon('icon[]');}
										</div>
									</div>
									
									<div class="col-xs-12 col-sm-12 col-md-4 col-lg-3 ">
										<div style="margin-left:-15px;margin-bottom:17px">
										<label class="checkbox-inline" style="vertical-align:bottom">
											<input type="hidden" name="isshow[]" value="">
											<input type="checkbox" onclick="$(this).prev().val(this.checked ? '1' : '0');"> 是否显示
										</label>
										
										<label class="checkbox-inline" style="vertical-align:bottom">操作</label>
										&nbsp; &nbsp; &nbsp; <a href="javascript:;" onclick="$(this).closest('.form-group').remove();" class="fa fa-times-circle" title="删除此操作"></a>
										</div>
									</div>									
								</div>
							</div>	
						</div>	
						
<script type="text/javascript">
	function addMenu(){
		var html = $("#form-option-menu").html();
		$("#form-menu").append(html);
	}		
</script>
{template 'common/footer'}